Current bitmap images are commonly encoded in eight (8) bit per color channel formats. In this instance, for a particular color channel, a total number of two-hundred and fifty-six (256) shades of color can be represented. Typically, two-hundred and fifty-six (256) shades of color per channel are enough for many photographic, display and printing needs.
However, with increased usage of high bit-depth medical images, graphical displays and large format printers, there is a need for a method to encode sixteen (16) bit per color channel images to provide a finer level of color gradients within a particular color channel. The finer level of color gradients is required as the human eye is able to distinguish color gradients to a greater number of levels than two-hundred and fifty-six (256).
There are a number of conventional methods for encoding sixteen (16) bit images. All of the conventional methods encode sixteen (16) bit images through the use of a primary image and a residual image in the spatial domain. The primary and residual images are combined to produce the original (or a lossy approximation of the original) sixteen (16) bit image.
The Joint Photographic Experts Group (JPEG) defines a method of lossy compression for bitmap images. JPEG compression allows lossy compression of bitmap images through the use of frequency domain encoding of image data. As an example, FIG. 3A shows a portion of a bitmap image 301. During a typical JPEG compression process, the bitmap image 301 is first divided into coding blocks (e.g., 311) of eight (8) by eight (8) pixels. A discrete cosine transform (DCT) is applied to each coding block to produce an eight (8) by eight (8) block of frequency domain coefficients. FIG. 3B shows an eight (8) by eight (8) block 305 of frequency domain coefficients produced by applying a DCT to the coding block 311. As seen in FIG. 3B, the block 305 comprises a DC coefficient 315 located at position (0, 0) and sixty-three (63) AC coefficients (e.g., 316) arranged in a zig-zag order 325. The higher the order of a particular AC coefficient (e.g., 316), the higher the frequency of energies that the particular AC coefficient encodes. In the spatial domain, high frequency energies within the image represent fast-varying values, and low frequency energies represent slow-varying gradients.
Following on from the DCT transform step, the sixty four (64) DCT coefficients are then quantized using a quantization table. Typically, the quantization table will quantize higher order AC coefficients to a greater degree. The greater quantization is due to the fact that the higher frequency energies that the AC coefficients encode can typically be represented with a smaller number of bits. Differing levels of quantization of the DCT coefficients can be used to control the size of the final coded image. Finally, the quantized DCT coefficients are losslessly encoded, for example using Huffman encoding.
Aside from quantization, one other method of controlling the size of a final coded image is to discard DCT coefficients of the image, starting from a highest frequency level coefficient and stopping once a desired memory target is reached. Such a method works because the majority of visual information in an image is encoded within the DC and lower AC coefficients.
A method of spectral JPEG encoding of images will now be described with reference to FIG. 4A and FIG. 4B. FIG. 4A shows DCT coefficients 410 of a coding block for an eight (8) bit image. For each such DCT coding block, the DCT coefficients 410 are stored within spectral bands of decreasing visual quality of the image. Increasing order of DCT coefficients is directly related to the decreasing impact of the DCT coefficients on visual quality of the image. Hence, the DCT coefficients 410 can be grouped into spectral partitions (e.g., 415 and 425) that are sorted by decreasing relevance to the overall image quality. In such an arrangement, the image quality can be degraded gradually through deletion of higher spectral partitions and their associated DCT coefficients. In this way it is possible to reclaim memory adaptively, by removing less relevant partitions first. For example, in an event that extra memory is required, partition AC55-AC63 in FIG. 4B is deleted first to reclaim the memory adaptively. The partition AC55-AC63 is deleted first because this partition is the least visually significant. If more memory is required, the next least visually significant partition AC45-AC54 is deleted to reclaim further memory.
FIG. 4A shows the partitioning of the DCT coefficients 410 with partitions 1 and 2 referenced as 415 and 425. FIG. 4B is a table showing a partitioning scheme for the DCT coefficients 410 of FIG. 4A. As seen in FIG. 4B, partition 1 (415) comprises the DC coefficient and partition 2 (425) comprises AC coefficients AC1, AC2 and AC3.
One limitation of the JPEG compression method is that it is only defined for images of up to twelve (12) bits per color component.
A need exists for a method of encoding high bit-depth images (i.e., greater than eight (8) bits).